<style>
    body {
        padding: 10px;
    }
</style>

<div class="my-btn-box">
    <span class="fl">
        <a class="layui-btn btn-add btn-default" onclick="open_iframe_dialog('/admin/cat/group_edit','添加',['450px','300px'],0)" id="btn-add">添加</a>
    </span>
</div>

<div class="layui-form datashow" data-url="/admin/cat/getdata_group" data-to-red="" data-condition="" data-p="1" data-row="10">
    <table class="layui-table">
        <colgroup>
            <col width="50">
            <col>
            <col>
            <col>
            <col width="140">
        </colgroup>
        <thead>
            <tr>
                <th><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose"></th>
                <th>ID</th>
                <th>分组名</th>
                <th>分组Key</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody class="data"></tbody>
    </table>
    <div class="page"></div>
    <script class="data-tpl" type="text/html">
        {{# layui.each(d, function(index, item){ }}
        <tr>
            <td><input type="checkbox" name="ids[]" value="{{item.id}}" lay-skin="primary">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon"></i></div>
            </td>
            <td class="param-uid">{{item.id}}</td>
            <td class="param-username">{{item.group_name}}</td>
            <td class="param-nickname">{{item.group_key}}</td>
            <td>
                <div class="layui-btn-group">
                    <button onclick="open_iframe_dialog('/admin/cat/group_edit/id/{{item.id}}','编辑分类分组',['450px','300px'],0)" class="layui-btn layui-btn-sm layui-btn-normal">编辑</button>
                    <button class="layui-btn layui-btn-sm layui-btn-danger mini_del" data-url="/admin/cat/group_del/ids/{{item.id}}">删除</button>
                </div>
            </td>
        </tr>
        {{# }); }} {{# if(d.length === 0){ }}
        <tr>
            <td colspan="5" style="text-align:center;">--- No Data ---</td>
        </tr>{{# } }}
    </script>
</div>

<script>
    layui.use(['miniweb', 'datashow'], function() {

    });

    function mini_callback() {
        layui.use('datashow', function() {
            layui.datashow($('.datashow'));
        });
        close_iframe_dialog();
    }
</script>